fixes bug that caused case insensitive queries to fail