check offset to be less than total