added a check to see what type of class a specific instance is