fixes for IN in query