[imp] changed the way validity is tested