rename serialize to stringify and fix edge case