Trying to get property 'topics' of non-object