made buffer emty everytime decode is called