fix issue with "a is undefined"