terminate functions added