change some logic and add tooltip func