fixing global context bug in shimming solution