Edited server to listen on connection failure.