select tree if valid