fixed the code that non-task code is also emitted for the host