Fixed issue #15

This issue was open by @WydD and provide the fix. I have tested and it works fine with the changes suggested. Please could you accept the request. Thanks