added date checks