env must be a dict