TypeError: Cannot read properties of null (reading 'filter')