Added some db functions