Using stop funtion instead of return