added stop sequence check routine