fixed bug in macro