fixed bug in workflow scripts (db not defined)