try to fix issues #38 and #51