fix env var replacement