fixed wrong offsetX reference