Mercedes Benz Mass airflow devise

I have a 2005 C230 Sport sedan. one day the car started miss firing and the OBC read that there was a Mas airflow unit malfunction. So I replaced the unit myself and the problem continued, However when I pull the pigtail (plug) from the devise the engine runs fine, Of course it will not pass smog this way. Can you help?

Check for air leaks anywhere between the Mass Airflow Sensor and the cylinders.

Thank You, I will