fix a bug during beta testing for issue #9
Thanks Andy1616