fixes #797