added QueryToStruct