fixed sql bug

fixed sql handler bug