moved method getParents inside Categoryprovider