fixed terminal bug