solve nested echo peoblem