updated javascript to prevent double-listing an event on assign