Added function for auto-detecting internal ip address