fixed sub-context handling