adjust logic on the profile editor
refine the error handling