create get environment method