fix bugs to support both lower and upper cases for element name