Optimized the way in which the application name is retrieved, fix an error caused when connecting to the app using an IP address.