Task01: fix issues with exit from function