BUGFIX: use more general isinstance instead of type