changed onclick to addEventListener