remove redundant file close
don't use shell