add proper exception handler for win32