added a flag to the terminate command which differs if the connection
still exists and should be closed or not