fix global environment, replace profile name with PROFILE_NAME