fix whitelist logic