fix #79
(cherry picked from commit 2e22be1)