Changed platform.indexOf(win) to regex as dawin has win in it.