fix for error_field for nil class error on SQL exception