Fix Crashing issue

Fix crashing issue when running is iOS device