add validate and improve agent log