Fixed bug with server in listen function.