fixing:needed a better way to retrieve hostname

better explanation here

http://stackoverflow.com/questions/7348711/recommended-way-to-get-hostname-in-java/7800008#7800008