Added try clause to layout_change.