improved context persistence
Merge pull request #69 from rodfernandez/maste_cls_fix

improved context persistence