writing also last enries to file