adding automatic state offset detection