Now adds eventListener to document instead of window

Been there, forked that. <3