fixes bug for declaring winner