finished logic for handling firebase store.