added masterHost and masterPort to imAgent