adding database functions