bug with num_contacts array