fix bug when using ports below 10000