fix to upstream master