How to get last element of array in lua