make first env default and fix newfile logic