fix bug in macro