Added save function to schema