Added new database functions