fixes #505