Added a few database functions