cleanup of terminal