query fix + cleanup