added a new macro  and fixed some issues