automatic distance correction