bug fix in windows - need to test in linux.