check database connection on startup