Added automatic IP detection