move env variable file creation to hook