when you use next command, it may run the program and it is impossible stop or leave
We'd need more details to understand this problem. You can normally use control-c to interrupt a running program. If this doesn't work, we'd need to know your platform, etc.