linesearch counter bug fixed