added this.ready() in publish function when this.userId in undefined