using toJSON instead of toObj now