fixes #509