incorporated bug fix from main