fixed to register the primary ip correctly