check enclosing frames of env