#38 fixed select query