fixed query from copy and paste