fix output and clear