dynamically change the "after" state of a form