Fixing crash for iOS