bugfix from upstream