modify how we check if we are in a secure environment