fix environment validation