Fixed error and updated date generation