changed event handler to allow values to be passed.