Adds filter to a given array of element