always uses isinstance , not 'type' as you did before with 'is'