changed the agent comms script to work on dynamic ip