helper function to install missing packages