moved listen() to after bind()