ErrorLog: changed the file closing as there were issues with the error
logger to not write. Changing back to old behaviour