Fixed bug with selected array