fixes #29 not applying query criteria using count