Philippine operator of online casino games at land-based digital terminals, PhilWeb, was given an official approval by the Philippine Securities and Exchange Commission (PSEC) to sell 53.76% of its shares to new chairman and soon-to-be majority stakeholder, Gregorio Ma Aranata III. The sale has been in the making since September 2016 when previous chairman Roberto Ongpin announced he would step down in order to save PhilWeb from regulatory obstacles posed by president Rodrigo Duterte.

PhilWeb was denied a license from the government in June as a result of Duterte’s call for a ban on online gambling. Former chairman Ongpin then tried to reason with the authorities by first offering his shares to gambling regulatory body PAGCOR and then by offering to donate and sell his shares and use the money to build drug rehab centers, but the government didn’t want to hear about it at the time.

However, PAGCOR had a change of heart in November following the contribution of PhilWeb to state coffers along with its employment of nearly 5,000 people, but allegedly also made Ongpin’s resignation a prerequisite for license approval. This lead the former chairman step down to make room for the second biggest stakeholder in the company, Araneta, in hopes of the authorities being friendlier with fresh management.

To finalize the plan, Araneta sought approval from the SEC to buy 653 million shares from Ongpin for the sum of 2 billion Philippine pesos, 118.5 million of which are to be bought at a later date. And according to SEC’s order, Amaneta has to finalize the second block of the transaction before the end date of his mandatory tender offer to minority shareholders in the company.

But despite the swap of execs, PhilWeb is yet to compete for a new license through a public process, making the company’s future in the Philippine gambling sector still far from safe.