fixes to the macro and to the xml and contents panel now works