Fixed crash bug when api down