Cancel button now works fine for both dialog and not ajax forms.