patch from #624