fixed env functions