optimizate the exception for windows