used addEventListener instead of onclick