fixed bugs for iOS