fixes #1240