changing select query