fixed some bugs with delete action