fix to guard for unknown query id