fixes #865