Add control code
Fix context setup