Fix bug with applyFilter