Very likely a wiring problem. Did you place two diodes to isolate the battery from power?

You can have more help if you post the schematic.

Cheers

Al.