Fixed crashing app with missing end