added recursion up the db while removing packages