Properly exit in windows