tested and fixed for windows.