added database functions