fix the security issue in which you could enter the wrong state
and edit data after it was agreed