Fixed indexing issue on events