Revert "switched from type() to isinstance()"

This reverts commit 8c23991f7ccd273d2b50adb9e24bc571831f972a.