moved environment path to use only when environment is defined.