Fixed Issue #648,changed the way of deleting parent