fixed to make it work in both win and mac
fixed to make it work in both win and mac