fix for a crash which went unnoticed in recent tests