Fixed a bug where onchange event was firing twice