fix bug with terminal creation