fix bug in huge file case