fixed potential bug of TypeSafety