handle uri w/o port properly and add unit test