updates for issue #665 and #624