modify IpAddress writing

I modify the ip address writing so it will be saved only when the user is already saved. This way we save one write operation per registration