fixed query nw, bug on slope