fix late state switching