Added firebase logic