improve error handling in UI