some groovy for validation