fixed bugs and cosmetic