updated environment handling for misconfigured servers