is the array not being returned correctly?