Extended validation function