fixes #585