Added checks for victory in commands