fixes #1001