add code validation