hack to terminate when done