fix template to layout