fix bug; support iOS 5