Fix critical bug in ios 6.