Revert "Reverted back until I can find the actual fix"

This reverts commit 4043d6e58f496bd08a05ad5eaba016e6faa1ec0a.