begin database stuff