fix sandbox mode detection