Added code for toggling the advance button.