filter working for both tables