improved error handling and general UI