updated generate slug method