added free buffer if there's a problem decoding