modified layout_script