fix crash while saving RDB