Fix code for modifying /etc/hosts