move button-addeventlistener function to callback