implemented filter fuctionallity