modified filter.js