error trycatch: TypeError: Cannot read properties of null (reading '_id')