hacked for use with ios 6.1 sdk