extra tem free removed; echo command added