refresh and error handling in tui