improved file persistence