now works on 'resource' pages too