make stop flag volatile