put try catch around publishing