Added safe read/write