finalizing terminal