tweaked addEventListener