more accurate way to check if packages is installed