code validation