added database(firebase) functionality