Fix bug with doing case insensitive comparison when updating count in db