adding some saving functionality