fixes bug when reading from firebase