Battery, power down when disconnecting power

I put a lipo battery in my BBB and I managed to make it work, and charge. The only issue is that when I disconnect power after charging the battery, the BBB shuts down. When I press the power button, it stays on. Is there a way to disable the board shutting down when disconnecting the power cord?