Added error messages and error handling for UI