added publish success and error functions and tests