change try except checks in sql handler