fixes #886

This should be fairly self-explanatory, but I'm happy to answer any questions.