exit not to be used inside functions