database check at the beginning of program