added mysql exception handler