update the layout and error handling