fix a terrible bug : totalStep++