minor changes for stop criteria