Setting createdAt in constructor