fix #28 : bugs of badge and window

#28