Terminate functionality added