added functionality: saving data