add install function and minor change