fixes #1106

This one looks like the right thing, please review