GEM_HOME logic changed