Tested error handling
Added remote publish parameter