Updated resource.py and reapplied fix