add layout render logic