fixed #310 and sidebar visual bug