Added database access functions