removed publish code, close connection call