changed initialization of array to nil