Fix crashing issue when delegate may deallocate