adds validation and test for presence of IP