fixed bug with island selection where the last index was inaccessible due to an error in array bounds checking