updated validate helper