checks victory condition