fixed terminal input bug