Chnaged slugIndex to boolean slugDefined.