bug fix for whole run