Change condition to get environment to set the protocol