Added a constructor and setting createdAt