Bug due to non-closing of streamwriter fixed.