fix crash and other UI bug