IOS6 compatibility

IOS6 compatibility