fixes #1005