changed delete to only allow empty items to be deleted