Fixed filterAttributes iteration bug