added filter code