fix a bug which the file for storing error log would not be removed