Classifying the company as Shariah compliant does not mean the company is completely pure. Based on AAOIFI guidelines, companies can have a threshold of up to 5% for non-compliant business activities. You can still hold that stock provided you purify the non-permissible income generated by the company.