finish installPackage function