fixing bug in filter cursor when no applicable element exists