fix prompt flush and break message on exit