fix crashing on iOS6