before optimize getnextstep