Remove item from sortable, on receive event.

Remove item from sortable, on receive event.

I have a draggable list connected to a sortable, and I want to limit the number of items the sortable can receive. 
So in the receive event of my sortable I'm doing something like this: 

  1. receive: function(event, ui) {
  2.       if(num_of_items >= threshold)
  3.       {
  4.             ui.item.remove();
  5.       }
  6. }
This give me the error:   Uncaught TypeError: Cannot read property 'options' of undefined

I can remove items on other events this way, but I really need to do it on the receive event. Any thoughts?