fixed bug in firebase error handler