bugfix/improve matchdate valid calculation