maybe a fix for #456 (needs testing)
Fix #456