clear query after sql build