fix scrolling on state change