editProfile function and associated ajax