prevented bad dates, fixed bugs