implementing serialblize for saving data