fix save bug with jquery ui dialog