fixed bug of cancelling with iOS5