ESP32 deep sleep clears RTC memory

Hi. I'm using wemos lolin32 board and I've connected it to a 18650 Li-ion 2600mA battery trough a TP2056+protection module. I'm storing a value with RTC_DATA_ATTR attribute andI need the value after each iteration of loop function. When I power the board through the usb port from my laptop everything is fine and value stays remain when board goes to sleep and wakes up but if the board is connected to battery the value will be reset after each wakeup (also time() value does reset).
I don't know if the problem is from wiring or my code or even from the board itself.

Posting them would be a good idea according to How to get the best out of this forum - Using Arduino / IDE 1.x - Arduino Forum

I solved out the problem. after each wakeup because of a line of code esp32 would crash(guru) and it was hard resetting and clearing RTC data