fix terminal resize method