fix bug on NOTNEEDBREAK and increase performance in setNextTarget