Fix some bugs, add unit test for Singletone design pattern, close UI to requested output