Fix: crashes because delegate not cleaned up properly