error handling and ui updates