fix for #8 and #9