Fixing race condition in whitelist