Fix a bug with wrong account name assignment when account has been edited