Fix for issue #1642
Adding code to only have one legend in the comments form at a time