Fixed javascript for endorsements