add patch from bsteger