fixed small bug with toArray

the toArray function was not starting at index 0 which was causing the
first button element to be ignored