fix crash caused by infinite loop; attributed text for button fix