fixes #1011