fixed segfaults when ui mode is not set