add .serialize method