Moved date checking block.