fixed some bugs for windows version