improved install method of pkg class