updated fn to remove package