fixed #17 issue

Works fine. Tested on my own project.