Implemented the saving action