check if cached object is the correct class