modify bug with terminated exit