fix depth bug, add remove_type method