remove echo and add header function