writeIfExists and readIfExists placement