fix issue #6 by initializing a new array before adding items