better trailing slashs handling