added support to save student state