finish the cascade delete function