fix offset problem