add patch from mihai