Terminate cli when script ends