Add win checking function