Cannot read property 'pr' of undefined