Fixed bug in loading records from firebase