added checks for existing packages