out txt file + error handeling