Change method to serialize