textmode cleanup