added filter logick