bug on query