updated registration to use hostname from agent