fixes #738
work on #697