added tests to verify behaviour, removed code that actually was looking at dirty/clean state (and not model values as previously thought)