fix bugs for iOS