fixed the regression when commenting out stop function