changed onChange location and update method