Added check for required fields when editing profile.