refactor, bug fix
fixed bug in gatekeeper that caused denial to crash server