fix terminal problem