merged modif from upstream
merged from upstream 2