How do I keep arduino working after unplug

No that does not happen.
Several people report this but in the end they always admit they are mistaken.