fix bug in query 1