Change try-catch to check is Activity finishing