Fixed the terminal code