error handling code when DB is down