fixes #227 untested