remove last element from array.