fixed destroy agent bug