fix offset computation for offline mode