A remark on the Torelli theorem for cubic fourfolds