change from type to isinstance