added database functions to setup database