use port number if it is set, fix for #14