new version with Firebase