added check for date