Fix crash when submitting changes