finish the main app