timing function changes to match ios 7