Fixed a compatibility issue with iOS5