fix Issue #1 (thanks to zhangpy)