change db to be case insensitive, and fixed problem in tail.py withstring concat