fixed error in cutting the console window length