fixed error handler for windows