Validate code