delating innecessary sql