fixed #100
(cherry picked from commit 6d2092e)
fixed #101
(cherry picked from commit 6684da4)