handle contacts.length === 0 degenerate case