fix bug on publish if arguments.length === 2