added a fix from @hackeron pull request