added null check for values in extraxt query keys function.