Add close method to publisher