gatekeeper in custody cases