fix js errors regarding to waterfall and run