Checking field type using isinstance instead of class name