Replace selectedIds with contacts itself