fix minor bug in treaty js