need to close the recorder here so it can calculate the content length properly