fixed query reduce method, added $not