fix package install logic