Changed "Write" to "Set" which is slightly more general.