Fix for #376

Signed-off-by: ziycon <ziycon.eire@gmail.com>
Updated fix for #376

Signed-off-by: ziycon <ziycon.eire@gmail.com>
Merge pull request #391 from ziycon/376

Fixes #376