add terminal end and home