reworked error accordion code for issue #171 and others
merge