Changed strlen to mb_strlen to account for multibyte characters