Copy the patch from Erik's repo (https://github.com/ebdevrepo/)

Github doesn't let me fork a single file so yeah. All credits to Erik.