Fixed bug for starting listener thread on server