title: Calculations with Firebase values
body: <p>I tried to make some easy calculation function where I can increase user's reputation, which is <code>String</code> inside Firebase. So I made it but the problem is instead of adding 1, it adds 2 and I do not see the logic error inside my code.</p>
  
  <pre><code>func reputationCalculation(){
  
          self.databaseRef.child("users").child(currentUser.generalDetails.uid).child("reputation").runTransactionBlock({
              (currentData:FIRMutableData!) in
  
              var count: Int = Int(self.currentUser.generalDetails.reputation)!// At this point it is 0 in my case
              count += 1// add one to previous value
              print(count)//print the value
              self.currentUser.generalDetails.reputation = String(count)//Set the value in Singleton
              self.reputationLabel.text = self.currentUser.generalDetails.reputation//Show on label
              currentData.value = String(count)
              return FIRTransactionResult.success(withValue: currentData)
  
          })
      }
  </code></pre>
  
  <p>For example, if the <code>func</code> is called when reputation in Firebase node is "0". It prints out <code>1</code> and <code>2</code> and sets the last value into Firebase. What is the problem?</p>