fixes #1006