generateSlug method