bug fix and new macro