fix bugs in install procedure