makes sure name is not empty
cleans error message and port number is no longer hard coded but passed value