fixing bad logic in local array macro