major changes to connect scritp