new feature in upstream

bring this to master