fix offset compuations