Added an onChange function to the dropdown menu.