modify win logic