Patched version to work with angularfire, firebase
Patched version to work with angularfire, firebase