Add error checking to saving profile changes