Why not just use auto-filter? seems much more simple