custom primitive type validation