update code for chosen panel