Modified how serialize work