updated test port for unit test and try/catch to catch address in use