Fix bug in editing profiles