Fixed logic for installing dependencies