fix bug: listen to port 0 throw exception