Added database check