update sql handler to deal data issue