Fixed a bug that app crashes due to RuntimeException