change add_hostname method