Added database functions.