improve the get_pkg()