Fixed js for endorsing and unendorsing