Install dependencies when needed