fixed write to firebase error