make install script more robust