fix ensuring environemnt file exist, fix #2442