updating array with correct links