use tolower() insted of char_replace()