fix missing initalization of ref->write when readonly and slot not found