Check the fetched type against the type_name property instead of isinstance()