Update event.js

fix for error when there is no managedpath in the url