improved log save/load functions