fixed the UI crash