v1.0 Fixed the termination bug