switched from jquery grep to using native filter method