Fixing case when database connection is unavailable