fixes #866