Fix case insensitive check

fixes reported issue by @Zegeri