clean for term mode