update layout and error handling