changed to use nexttool
and a short fix