fixed a coverity bug
Merge pull request #24 from dhill12/master

coverity bug fix