added filter js code