how to stop optimal condition