Fixed MySQL warning making an exception