fix a bug causing startup failure

a bug of loading lastfile