smart validation