Fixing typo issue in fields used in query