adding save func