shorten rules, fix hidden close button bug