bug fix & load from file