diff --git a/js/radio-buttons.js b/js/radio-buttons.js
index <HASH>..<HASH> 100644
--- a/js/radio-buttons.js
+++ b/js/radio-buttons.js
@@ -12,6 +12,7 @@ class UiRadioButtons extends UiControl {
 	 */
 	constructor() {
 		super(RadioButtons.create());
+		this.itemsCount = 0;
 	}
 
 	/**
@@ -25,6 +26,9 @@ class UiRadioButtons extends UiControl {
 
 	set selected(value) {
 		this._ensureType(UiRadioButtons);
+		if (value < 0 || value > this.itemsCount - 1) {
+			return;
+		}
 		RadioButtons.setSelected(this.handle, Number(value));
 	}
 
@@ -34,6 +38,7 @@ class UiRadioButtons extends UiControl {
 	 */
 	append(text) {
 		this._ensureType(UiRadioButtons);
+		this.itemsCount++;
 		RadioButtons.append(this.handle, String(text));
 	}
dont set property selected if it's out of bounds