checks for DB before running