add database exception handler