model - bug fix

replace a writeLocal w/ a writeToMemoryAndLocal