Exiting function on leave for simplicity