fixed a bug when used in terminal
update