Added step forward in scan, so that it actually terminates