fixed bug in macros