Context switching fix