fixed bug in win checking