problem with creating token sending headers after the event. Need to check it.