Update generate function and ADD nested object handle.