fixed io bug in windows. better exceptions