use new firebase logic