Fixed bug where event wasn't defined in the document click event handler.