Added database functions