added slugify function more fault-tolerant