fixed array update code