fixed issue #1, please review

i did a little research and think this is the fix to my own issue #1