Exiting from functions actually terminates the script