embed tui, added max count function and validation