fixes #40
partial fix for #39