added win flag to prevent win condition triggering multiple times