generate slug method