Filter function fixed!!!