Close connection after get the profile name