this has to be attached to a click handler