Added code for switching "active" item.