Fix ap query cache