simple validation macro