added database functionalities