Add  method to tmp_file to commit properly