     loggedIn: "annotator-readmill-logged-in"
 
   template: """
-  <div class="annotator-readmill">
-    <a class="annotator-readmill-avatar" href="" target="_blank">
-      <img src="" />
-    </a>
-    <div class="annotator-readmill-user">
-      <span class="annotator-readmill-fullname"></span>
-      <span class="annotator-readmill-username"></span>
-    </div>
-    <div class="annotator-readmill-book"></div>
-    <div class="annotator-readmill-connect">
-      <a href="#">Connect with Readmill</a>
-    </div>
-    <div class="annotator-readmill-logout">
-      <a href="#">Log Out</a>
-    </div>
+  <a class="annotator-readmill-avatar" href="" target="_blank">
+    <img src="" />
+  </a>
+  <div class="annotator-readmill-user">
+    <span class="annotator-readmill-fullname"></span>
+    <span class="annotator-readmill-username"></span>
+  </div>
+  <div class="annotator-readmill-book"></div>
+  <div class="annotator-readmill-connect">
+    <a href="#">Connect with Readmill</a>
+  </div>
+  <div class="annotator-readmill-logout">
+    <a href="#">Log Out</a>
   </div>
   """
 
   constructor: () ->
-    super jQuery(@template)
+    super jQuery("<div class=\"annotator-readmill\">").html(@template)
 
   connect: ->
-    this.publish "connect", this
+    @publish "connect", [this]
 
   login: (user) ->
     @updateUser(user) if user


    unless options?.silent is true
      Annotator.showNotification "Successfully connected to Readmill"

  error: (message) ->
    Annotator.showNotification message, Annotator.Notification.ERROR

    @client = new Readmill.Client @options

    @view.subscribe "connect", @connect
    @view.subscribe "disconnect", @disconnect

    token = options.accessToken || @store.get "access-token"
    @connected(token, silent: true) if token
