fixed firebase with suggestion from stack overflow