fix error on model save before change + add tests