Fix clickedWidget indexing in UI