fixes potential division-by-zero error
Merge pull request #15 from thiagohersan/master

fixes potential division-by-zero error