unbind document listener if using the javascript api