some ugly codes for ui