add a check to exit the prog :)