updated version, now works with filter elements