add caseInsensitive and some bug fixed