remove defer in pubsub_http and pubsub_tcp