corrected offset bug on ios