bug fix in spark workflow