renamed local 'contacts' variables to 'sc' to avoid confusion with class variable 'contacts'