Fix the filtering based on id problem