add spec test and fix top bar name display bug