error handling and styling