replaced strlen with mb_strlen function