bug fix to run on data