fix atomic bug for windows