Revert "Revert "fix for #20""

This reverts commit 049dc81d1f325e7e3b5bf5f8569298171bdbe6f7.