Adding a listener to form submits to handle unexpected changes