How did the Ottomans overcome an internal crisis