fixed endoffset starting before start offset problem