code validation design issue