fix for most cases affected by #21