Fix query clean