Fixed a bug that app crashes on iPhone