Add db connection error handling