added tests and fixed bug with concurrent IP assignment