Improving date checking and functionality