Return the proper value in the callback for window destruction
Code cleanup