Modify get_env in misc