fix the offset issue