fixed automatic ip detection