bug fixed, save func work