Changed registerIP logic