Fix crash on finishing app