fix to remove multiple trailing chain characters