added date check