removed unnecessary sql query