fix bug for multi scopes