improve csv persistence