fix bug in dbs workflow completion query