more robust install script