saving changes now also works for ajax requests too