fixed the eventListener

the eventListener was assigned to the document and not the button.