Fixing type checking -> isinstance