fix fetch_class bug