fix bug that can't connect automatically after app crash