added a new helper function: Utils::isValidPort().
added code to use the port number in the DB.