How do I keep arduino working after unplug

Maybe I don't explain myself

Yes you did.
Maybe you did not understand my answer?

If code runs it is running from flash memory. This is non volatile memory and so is not lost when you remove the power.
If you truly have this effect then your processor is hosed, but I have seen people here report this effect only later to find out they made a mistake.