layout and error handling