fixed error in delete