Why wont my function exit correctly?

Printable View