Add function to get frame element at the ith index