fix bug with new array