Cannot get property 'access_type' on null object