changed applyArgv calling after environments loaded