code for gatekeeper extension