add close connection listener