fix #6 termination