fixing bug where State was bad html safe  before the model could use it causing  encoded model states