   createSlug:(callback)->
     {constructor} = this
     {slugifyFrom} = constructor
-    slug = generateSlug @[slugifyFrom]
-    generateUniqueSlug constructor, slug, callback
+    slug = slugify @[slugifyFrom]
+    generateUniqueSlug constructor, slug, 0, callback

      .replace(/^-+|-+$/g, "")      # trim leading and trailing hyphens

  generateUniqueSlug =(constructor, slug, i, callback)->
    [callback, i] = [i, callback] unless callback
    i ?= 0
    candidate = "#{slug}#{i or ''}"
    constructor.count slug: candidate, (err, count)->
      if err then callback err

module.exports = class Slugifiable

  slugify =(str)->
    slug = str
      .toLowerCase()                # change everything to lowercase
      .replace(/^\s+|\s+$/g, "")    # trim leading and trailing spaces
