bug fix to macro