written some of echo handler