env vars replacement fix