added has many and corrected scope return value